package com.chenhao.springcloud.chenhaodesignservice.pattern.creational.singleton;

/**
 * Description:枚举类单例模式
 *
 * @author chenhao
 * @date 2020/12/21 9:35
 */
public enum EnumInstance {
    INSTANCE {
        protected void printTest() {
            System.out.println("chenhao print");
        }
    };
    private Object data;

    public Object getData(){
        return data;
    }

    public void setData(Object data){
        this.data= data;
    }
    public static  EnumInstance getInstance(){
        return  INSTANCE;
    }
}
